<template>
    <div>
        <p>新增字典</p>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="字典名称">
                <el-input v-model="form.dicname"></el-input>
            </el-form-item>
            <el-form-item label="字典编码">
                <el-input v-model="form.code"></el-input>
            </el-form-item>
            <el-form-item label="字典描述">
                <el-input v-model="form.desc"></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
import bus from '@/components/common/bus';
export default {
    data() {
        return {
            form: {
                dicname: '',
                code: '',
                desc: ''
            }
        };
    },
    props: ['isSon'],
    watch: {
        form: {
            immediate: true,
            handler(val) {
                if (this.isSon) {
                    bus.$emit('getForm2', val)
                } else {
                    bus.$emit('getForm', val)
                }
            }
        }
    }
};
</script>

<style  lang="less" scoped></style>
